<?php /*a:3:{s:79:"/Applications/MAMP/htdocs/voice/application/admin/view/content/music/index.html";i:1572919079;s:78:"/Applications/MAMP/htdocs/voice/application/admin/view/_public/table_page.html";i:1572919079;s:79:"/Applications/MAMP/htdocs/voice/application/admin/view/_public/public_head.html";i:1572919079;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <title><?php echo htmlentities(app('config')->get('app_name')); ?></title>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="/static/admins/static/css/font.css">
    <link rel="stylesheet" href="/static/admins/static/css/weadmin.css">
    <link rel="stylesheet" href="/static/admins/static/css/liteadmin.css">
    <script type="text/javascript" src="/static/admins/lib/layui/layui.js" charset="utf-8"></script>
    <script>
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?2f4623b47bd40e7fc01c346fa2fa4daa";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    <script>
        // layui.extend({
        //     admin: '{/}/static/admins/static/js/admin',
        //     background: '{/}/static/admins/static/js/background',
        //     liteadmin: '{/}/static/admins/static/js/liteadmin',
        //     'browser-md5-file': '{/}/static/admins/static/js/browser-md5-file',
        // });
        layui.config({
            // base: '/static/admins/lib/layui/lay/modules/',
            base: '/static/admins/static/js/',
            version: '101100'
        }).use(['admin','liteadmin']);
    </script>
    <style>
        .layui-table{
            width: 1px;
            white-space: nowrap; /* 自适应宽度*/
            word-break:  keep-all; /* 避免长单词截断，保持全部 */
            min-width: 100%;
        }
    </style>
</head>
<body>
<!--面包屑-->
<div class="weadmin-nav">
    <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href=""><?php echo htmlentities($ctitle); ?></a>
        <a><cite><?php echo htmlentities($atitle); ?></cite></a>
    </span>
    <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">&#xe669;</i></a>
</div>
<!--面包屑-->
<div class="weadmin-body">
    
<div class="layui-row">
    <form class="layui-form layui-col-md12 we-search" action="<?php echo request()->url(); ?>" method="get">
        <div class="layui-inline">
            <input type="text" name="title" value="<?php echo htmlentities(app('request')->get('title')); ?>" placeholder="请输入分类名称（支持模糊搜索）" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-inline">
            <select name="state">
                <option value="">请选择分类状态</option>
                <option value="0" <?php if(app('request')->get('state') == '0'): ?>selected<?php endif; ?>>待审核</option>
                <option value="1" <?php if(app('request')->get('state') == '1'): ?>selected<?php endif; ?>>已通过</option>
                <option value="2" <?php if(app('request')->get('state') == '2'): ?>selected<?php endif; ?>>已拒绝</option>
                {/volist}
            </select>
        </div>
        <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
    </form>
</div>

    
<div class="weadmin-block" style="overflow: hidden">
    <?php if(auth("$classuri/del")): ?>
    <button class="layui-btn layui-btn-xs" data-post-batch='<?php echo url("$classuri/del"); ?>' data-title="批量删除">批量删除</button>
    <?php endif; if(auth("$classuri/add")): ?>
    <button class="layui-btn layui-btn-xs" data-modal='<?php echo url("$classuri/add"); ?>' data-title="添加录音">添加录音</button>
    <?php endif; ?>
</div>

    <div style="overflow: auto">
        
<table class="layui-table" lay-even lay-skin="line" lay-size="sm">
    <thead>
    <tr>
        <th>
            <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
        </th>
        <th>id</th>
        <th>语音库</th>
        <th>试听</th>
        <th>状态</th>
        <th>操作</th>
    </thead>
    <tbody>
    <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    <tr style="background-color: white;">
        <td>
            <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='<?php echo htmlentities($vo['id']); ?>'><i class="layui-icon">&#xe605;</i></div>
        </td>
        <td><?php echo htmlentities($vo['id']); ?></td>
        <td><?php echo htmlentities($vo['title']); ?></td>
        <td style="background-color:white;">
            <audio controls="controls" style="height: 20px;">
                <source src="<?php echo htmlentities($vo['pic']); ?>"> </source>
            </audio>
        </td>
        </td>
        <td>
            <?php if($vo['state'] == 0): ?>待审核<?php endif; if($vo['state'] == 1): ?>已通过<?php endif; if($vo['state'] == 2): ?>已拒绝<?php endif; ?>
        </td>
        <td>
             <?php if($vo['state'] == 0): if(auth("$classuri/change")): ?>
                <button class="layui-btn  layui-bg-orange layui-btn-xs layui-btn-<?php echo $vo['state']?'warm':'primary'; ?>" href="javascript:;" data-confirm="确定操作该条数据吗？"
                        data-post='<?php echo url("$classuri/change"); ?>' data-param='id=<?php echo htmlentities($vo['id']); ?>&state=<?php echo abs($vo['state']-1); ?>'>通过

                </button>
                <?php endif; if(auth("$classuri/change")): ?>
                <button class="layui-btn layui-btn-danger layui-btn-xs layui-btn-<?php echo $vo['state']?'warm':'primary'; ?>" href="javascript:;" data-confirm="确定操作该条数据吗？"
                        data-post='<?php echo url("$classuri/change"); ?>' data-param='id=<?php echo htmlentities($vo['id']); ?>&state=<?php echo abs($vo['state']+2); ?>'>拒绝
                </button>
                <?php endif; ?>
             <?php endif; if(auth("$classuri/del")): ?>
             <button class="layui-btn layui-btn-xs" href="javascript:;"
                    data-confirm="确定要删除吗！" data-post='<?php echo url("$classuri/del"); ?>' data-param='ids=<?php echo htmlentities($vo['id']); ?>'>
                删除
             </button>
             <?php endif; ?>
        </td>
    </tr>
    <?php endforeach; endif; else: echo "" ;endif; ?>
    </tbody>
</table>
<?php echo $page; ?>
<script>
    var audios = document.getElementsByTagName("audio");
    // 暂停函数
    function pauseAll() {
        var self = this;
        [].forEach.call(audios, function (i) {
            // 将audios中其他的audio全部暂停
            i !== self && i.pause();
        })
    }
    // 给play事件绑定暂停函数
    [].forEach.call(audios, function (i) {
        i.addEventListener("play", pauseAll.bind(i));
    })
</script>

    </div>
</div>

<script>
</script>

</body>
</html>